<template>
	<view class="pageItem">
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="back iconfont icon-gengduo-copy" @tap="backPage"></view>
			<view class="text">抵用券</view>
		</view>
		<view class="clear_box"></view>
		<view class="head">
			<view class="h_row">
				<view class="iconfont h_icon">&#xe681;</view>
				<view class="h_r_txt">总抵用券</view>
				<view class="num">20<label class="code">张</label></view>
			</view>
			<view class="tabber">
				<view class="tab" :class="type == 'all'?'tab_s':''" @click="typeChange('all')">全部</view>
				<view class="tab" :class="type == '0'?'tab_s':''" @click="typeChange('0')">未使用</view>
				<view class="tab" :class="type == '1'?'tab_s':''" @click="typeChange('1')">已使用</view>
				<view class="tab" :class="type == '2'?'tab_s':''" @click="typeChange('2')">已过期</view>
			</view>
		</view>
		<view class="list">
			<block v-for="(item,index) in 10" :key="'v_'+index">
				<view class="l_row">
					<image class="l_r_bg" src="../../static/img02/voucher.png"></image>
					<view class="price"><label class="code">￥</label>20</view>
					<view class="msg">
						<view class="msg_con">
							<view class="m_t1">无门槛使用</view>
							<view class="m_t2">距到期仅剩 2天</view>
						</view>
						<view class="btn">去使用</view>
					</view>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type:'all'
			};
		},
		methods:{
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},
			typeChange(_type){
				if(this.type != _type){
					this.type = _type;
				}
			}
		}
	}
</script>
<style>
page{
	background: #F6F8FA;
	padding-bottom: 21vw !important;
}
.pageItem{
	width: 100%;
	box-sizing: border-box;
}
.pageItem *{
	box-sizing: border-box;
}
</style>
<style lang="scss">
.head{
	position: fixed;
	z-index: 98;
	width: 100%;
	background: #F6F8FA;
	padding: 3vw 4% 1vw;
	.h_row{
		height: 13vw;
		padding: 0 4vw;
		display: flex;
		align-items: center;
		background: #ffffff;
		border-radius: 30rpx;
		.h_icon{
			padding-top: 1vw;
			font-size: 6vw;
			color: #FA5400;
		}
		.h_r_txt{
			flex: 1;
			font-size: 4.5vw;
			font-weight: bold;
			color: #222325;
			padding: 0 25rpx;
		}
		.num{
			font-size: 4.5vw;
			font-weight: bold;
			color: #FA5400;
			.code{
				color: #222325;
				padding-left: 5rpx;
			}
		}
	}
	.tabber{
		height: 12vw;
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-around;
		padding-bottom: 1vw;
		.tab{
			min-width: 15%;
			height: 11vw;
			line-height: 11vw;
			text-align: center;
			font-size: 3.5vw;
			color: #69717A;
		}
		.tab_s{
			position: relative;
			font-weight: bold;
			color: #091624;
			&::after{
				content: '';
				position: absolute;
				bottom: 1vw;
				height: 1vw;
				width: 30%;
				left: 35%;
				background: #FA5400;
				border-radius: 1vw;
			}
		}
	}
}
.list{
	padding: 29vw 4% 0;
	.l_row{
		width: 100%;
		height: 20vw;
		position: relative;
		margin-top: 25rpx;
		display: flex;
		align-items: center;
		.l_r_bg{
			position: absolute;
			z-index: 1;
			width: 100%;
			height: 20vw;
		}
		.price{
			position: relative;
			z-index: 2;
			width: 28%;
			text-align: center;
			font-size: 7vw;
			color: #FA5400;
			.code{
				font-size: 5vw;
			}
		}
		.msg{
			position: relative;
			z-index: 2;
			flex: 1;
			display: flex;
			align-items: center;
			padding: 0 4vw;
			.msg_con{
				flex: 1;
				.m_t1{
					font-size: 4vw;
					font-weight: bold;
					color: #333333;
				}
				.m_t2{
					font-size: 3vw;
					color: #999999;
					padding-top: 1.5vw;
				}
			}
			.btn{
				padding: 10rpx 20rpx;
				border-radius: 4vw;
				background: #FA5400;
				color: #ffffff;
				font-size: 3vw;
			}
		}
	}
}
</style>
